import { BblDesk } from "../entity/desk.entity";
import { BblDeskBrand } from "../entity/desk-brand.entity";
import { BblDeskType } from "../entity/desk-type.entity";
import { AttachDto } from "./att.dto";

/**
 * 球桌添加传输对象
 */
export class DeskCreateDto {
  deskName: string;
  deskParamImgIds: string;
  deskThumbId: string;
  deskBrandId: string;
  deskTypeId: string;
  deskPrice: number;
  deskRemark: string;
  deskIndex: number;
}

/**
 * 球桌列表查询传输对象
 */
export class DeskListQueryDto {
  deskName: string;
  deskBrandId: string;
  deskTypeId: string;
}

/**
 * 球桌分页查询传输对象
 */
export class DeskPageQueryDto {
  deskName: string;
  deskBrandId: string;
  deskTypeId: string;
  pageSize: string;
  current: string;
}

/**
 * 球桌列表传输对象
 */
export class DeskListDto {
  constructor(desk: BblDesk) {
    this.deskId = desk.deskId;
    this.deskName = desk.deskName;
    this.deskBrand = desk.deskBrand;
    this.deskType = desk.deskType;
    this.deskPrice = desk.deskPrice;
    this.deskRemark = desk.deskRemark || "";
    this.deskIsDeleted = desk.deskIsDeleted;
    this.deskIndex = desk.deskIndex;
    this.createdAt = desk.createdAt.valueOf();
  }

  deskId: string;
  deskName: string;
  deskBrand: BblDeskBrand;
  deskType: BblDeskType;
  deskPrice: number;
  deskRemark: string;
  deskIsDeleted: number;
  deskIndex: number;
  createdAt: number;
}

/**
 * 球桌列表传输对象
 */
export class DeskWxListDto {
  constructor(desk: BblDesk) {
    this.deskId = desk.deskId;
    this.deskName = desk.deskName;
    this.deskBrand = desk.deskBrand;
    this.deskType = desk.deskType;
    this.deskPrice = desk.deskPrice;
    this.deskRemark = desk.deskRemark || "";
    this.deskIsDeleted = desk.deskIsDeleted;
    this.deskIndex = desk.deskIndex;
    this.createdAt = desk.createdAt.valueOf();
    this.deskThumb = new AttachDto(desk.deskThumb);
  }

  deskId: string;
  deskName: string;
  deskBrand: BblDeskBrand;
  deskType: BblDeskType;
  deskPrice: number;
  deskRemark: string;
  deskIsDeleted: number;
  deskIndex: number;
  createdAt: number;
  deskThumb: AttachDto;
}

/**
 * 球桌详情传输对象
 */
export class DeskInfoDto {
  constructor(desk: BblDesk) {
    this.deskId = desk.deskId;
    this.deskName = desk.deskName;
    this.deskBrand = desk.deskBrand;
    this.deskType = desk.deskType;
    this.deskPrice = desk.deskPrice;
    this.deskRemark = desk.deskRemark || "";
    this.deskIsDeleted = desk.deskIsDeleted;
    this.deskIndex = desk.deskIndex;
    this.createdAt = desk.createdAt.valueOf();
    this.deskThum = new AttachDto(desk.deskThumb);
    this.deskParamImgs = desk.deskParamImgs.map((att) => new AttachDto(att));
  }

  deskId: string;
  deskName: string;
  deskBrand: BblDeskBrand;
  deskType: BblDeskType;
  deskThum: AttachDto;
  deskParamImgs: AttachDto[];
  deskPrice: number;
  deskRemark: string;
  deskIsDeleted: number;
  deskIndex: number;
  createdAt: number;
}
